package com.simp;

import lombok.extern.slf4j.Slf4j;
import org.jasypt.encryption.StringEncryptor;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;


/**
 * @author pan.shun
 * @version 2.0
 * @since 2021/11/8 21:07
 */
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest
public class SimpleLabelTest {

    @Autowired
    private StringEncryptor encryptor;
    //
    @Autowired
    private RedisTemplate<String, Object> redisTemplate;

    @Test
    public void testRedis() {
//        Boolean zhangsan = redisTemplate.opsForValue().setIfAbsent("zhangsan", 1, 60, TimeUnit.SECONDS);
//
//        log.info("是否存在 ：{}",zhangsan);
    }

    /**
     * 生成ENC 加密串
     */
    @Test
    public void contextLoads() {
//        String userName = "";
//        String password = "";
//        String userName1 = encryptor.encrypt(userName);
//        String password2 = encryptor.encrypt(password);
//        log.info("加密用户名 ： {}", userName1);
//        log.info("加密密码 ： {}", password2);


    }
}
